home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
soundc.arc
/
SOUND.C
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1990-03-29
|
399 b
|
33 lines
/* Sounds speaker */
#include <wesson.h>
void sound(int freq, int duration)
{
_asm \
{
mov al, 0B6h
out 43h, al
mov dx, 12h
mov ax, 34DEh
div freq
out 42h, al
mov al, ah
out 42h, al
in al, 61h
or al, 3
out 61h, al
}
delay((clock_t)duration);
_asm \
{
in al, 61h
xor al, 3
out 61h, al
}
}